package com.yvon.maple.service.system.query;

import com.yvon.boot.mybatis.search.MpOrder;
import com.yvon.boot.mybatis.search.MpSearch;
import com.yvon.boot.mybatis.search.PageQuery;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserQuery extends PageQuery {

    /**
     * 昵称-模糊查询
     */
    @MpSearch(operate = MpSearch.Operator.like)
    private String nickname;

    /**
     * 用户名-精确匹配
     */
    @MpSearch(operate = MpSearch.Operator.like)
    private String username;

    /**
     * 电话-精确匹配
     */
    @MpSearch(operate = MpSearch.Operator.like)
    private String phone;

    /**
     * 状态-精确匹配
     */
    private Boolean enabled;

    /**
     * 创建时间开始-范围查询
     */
    @MpSearch(fieldName = "create_time", operate = MpSearch.Operator.betweenStart)
    private String createTimeBegin;

    /**
     * 创建时间结束-范围查询
     */
    @MpSearch(fieldName = "create_time", operate = MpSearch.Operator.betweenEnd)
    private String createTimeEnd;

    /**
     * 创建时间-顺序
     */
    @MpOrder(fieldName = "create_time")
    private MpOrder.Order createTimeOrder;
}
